import request from "../utils/request";
const baseURL = "/users";

// 获取用户指定信息
export const getSpecifyUserInfo = data =>
	request({
		method: "get",
		url: baseURL + "/getSpecifyUserInfo",
		data,
	});

// 添加文章的信息，比如访问量、点赞、收藏等
export const userAugment = (article_id, user_id, strOptions) =>
	request({
		method: "post",
		url: baseURL + "/augment",
		data: { article_id, user_id, options: strOptions },
	});

export const updateInfo = data =>
	request({
		method: "post",
		url: baseURL + "/updateInfo",
		data,
	});

// 修改用户头像
export const updateProfile = data =>
	request({
		method: "post",
		url: baseURL + "/updateProfile",
		data,
	});

// 上传用户封面
export const updatePicBg = data =>
	request({
		method: "post",
		url: baseURL + "/updatePicBg",
		data,
	});

// 增加历史浏览记录
export const addHistory = data =>
	request({
		method: "post",
		url: baseURL + "/addHistory",
		data,
	});

// 清空历史浏览记录
export const clearHistory = user_id =>
	request({
		method: "post",
		url: baseURL + "/clearHistory",
		data: { user_id },
	});
